import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { ServiceBasic } from '../../kalend';

@Injectable({
  providedIn: 'root'
})
export class MerchantwineService extends ServiceBasic {

  constructor(http: Http) {
    super('/merchantwine', http);
  }
  querybymid(doc: any) {
    return this.httppost(`/queryonebymid`, doc);
  }

  queryone(doc: any) {
    return this.httppost(`/queryone`, doc);
  }

  queryonewineapply(doc: any) {
    return this.httppost(`/queryonewineapply`, doc);
  }

  queryById(id: any) {
    return this.httpget(`/queryById/${id}`);
  }
  lock(id: any) {
    return this.httpget(`/lock/${id}`);
  }
  open(id: any) {
    return this.httpget(`/open/${id}`);
  }

  calcmerchantMaxWineApplyCount(doc: any) {
    return this.httppost(`/calcmerchantMaxWineApplyCount`, doc);
  }


  createWineApply(doc: any) {
    return this.httppost(`/savewineapply`, doc);
  }

  // 查询商户补货申请
  querymerchantapplywinebypage(doc: any) {
    return this.httppost(`/querymapplywinebyagent`, doc);
  }


  // 更新补货状态
  auditmappwinestatus(doc: any) {
    return this.httppost(`/auditmappwinestatus`, doc);
  }

  // 计算商户佣金抽成比例
  calcmerchantrate(doc: any) {
    return this.httppost(`/calcmerchantrate`, doc);
  }
  /** 更新库存信息 */
  agentupdatwinesstock(doc: any) {
    return this.httppost(`/agentupdatwinesstock`, doc);
  }
}
